package com.ec.gateway;

import com.ec.core.redis.redisson.config.RedissonConfig;
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @description:
 * @author: Eric Lee
 * @time: 2021/5/20 18:04
 */

@EnableHystrix
@EnableAsync
@SpringBootApplication(exclude = {RedissonConfig.class,RedissonConfig.class})
@EnableDiscoveryClient
@EnableEncryptableProperties
public class GatewayApplication {
    public static void main(String[] args) {
        try {
            SpringApplication.run(GatewayApplication.class, args);
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }

    /**
     * 设置@Value注解取值不到忽略（不报错）
     *
     * @return
     */
    @Bean
    public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
        PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer();
        c.setIgnoreUnresolvablePlaceholders(true);
        return c;
    }
}
